package com.eternal.permission.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.eternal.permission.dao.RoleInfoMapper;
import com.eternal.permission.entity.RoleInfo;
import com.eternal.permission.entity.UserRole;
import com.eternal.permission.dao.UserRoleMapper;
import com.eternal.permission.service.UserRoleService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 * 用户角色表 服务实现类
 * </p>
 *
 * @author Eternal
 * @since 2018-08-26
 */
@Service
@Transactional
@Primary
@Accessors()
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements UserRoleService {

    @Autowired
    private RoleInfoMapper roleInfoMapper;


    @Override
    public List<RoleInfo> getRoleByUserId(String userId) {
        Wrapper<RoleInfo> wrapper = new EntityWrapper();
       List<RoleInfo> list=roleInfoMapper.selectRoleByUserId(userId);
        return list;
    }
}
